#include "shm.hpp"
#include <cstdlib>
#include "namePipe.hpp"

int main()
{
    Shm shm(gpathname, gprojid, CREATER);
    NamedPipe fifo(comPath.c_str(), sever);
    fifo.OpenForWrite();
    sleep(3);
    char *pshm = (char *)shm.Addr();

    for (char ch = 'a'; ch <= 'z'; ++ch)
    {
        pshm[ch - 'a'] = ch;
        std::string s = "wake up";        
        cout<<"writen "<<s<<endl;
        fifo.Write(s);//在往共享内存中写入数据之后，在会向管道的写端写入数据，标识已经往共享内存中写完了

        sleep(1);
    }
    return 0;
}